﻿<Window x:Class="WpfPdfReader.WindowProgressBar"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="WindowProgressBar" Height="180" Width="600" Loaded="Window_Loaded" WindowStyle="None"  WindowStartupLocation="CenterOwner">
    <Window.Resources>
        <LinearGradientBrush x:Key="g1" StartPoint="0,0" EndPoint="1,1">
            <GradientStop Color="LightGreen" Offset="0"/>
            <GradientStop Color="Green" Offset="0.5"/>
            <GradientStop Color="DarkGreen" Offset="1"/>
        </LinearGradientBrush>
        <Style  
     TargetType="{x:Type ProgressBar}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ProgressBar}">
                        <Grid MinHeight="14" MinWidth="200">
                            <Border   
            Name="PART_Track"   
            CornerRadius="20"  
            BorderBrush="DarkGreen"  
            BorderThickness="1" Background="AliceBlue" />
                            <Border   
           x:Name="PART_Indicator"   
           CornerRadius="16"   
           BorderBrush="DarkGreen"   
           BorderThickness="1"   
           HorizontalAlignment="Left" >
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="LightGreen" Offset="0"/>
                                        <GradientStop Color="Green" Offset="0.5"/>
                                        <GradientStop Color="DarkGreen" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="100"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
            <ProgressBar Grid.Row="0" x:Name="progressBar" Margin="20,40,20,0"  OverridesDefaultStyle="True" RenderTransformOrigin="0.5,0.5" Value="60">
                <ProgressBar.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </ProgressBar.RenderTransform>
                <ProgressBar.Foreground>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FF24EE27" Offset="0"/>
                        <GradientStop Color="#FF5434AC" Offset="0.5"/>
                        <GradientStop Color="#FFB371EA" Offset="1"/>
                    </LinearGradientBrush>
                </ProgressBar.Foreground>
            </ProgressBar>
            <TextBlock Grid.Row="1" Margin="20,10,20,10" Name="status" Text="正在处理..." FontSize="16"></TextBlock>
        </Grid>
    </Grid>
</Window>
